package com.czhoujunlv.drug.DBManager;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class CreateTable extends SQLiteOpenHelper {
    public CreateTable(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        //在这个方法里面来建表
        String sql = "create table buygoods(id integer primary key,name varchar(50),img varchar(100),des varchar(250),number int,businessId int,salemoney Double,goodid int)";
        db.execSQL(sql);// 这一步就完成了加载驱动和建立连接
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
